package com.chris.libs.example.pages.ext.http;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.chris.libs.example.model.results.UserInfo;

/**
 * @author Chris Chan
 * Create on 2025-02-03 06:00
 * Use for: Build 数据中心
 * Explain:
 */
public class HttpViewModel extends ViewModel {
    // 示例数据
    private MutableLiveData<String> info;
    private MutableLiveData<UserInfo> userInfo;

    // 构造方法
    public HttpViewModel() {
        info = new MutableLiveData<>();
        userInfo = new MutableLiveData<>();
        setInfo("基本框架测试");
    }

    // 示例数据读取
    public MutableLiveData<String> getInfo() {
        return info;
    }

    // 示例数据赋值
    public void setInfo(String info) {
        this.info.setValue(info);
    }

    public MutableLiveData<UserInfo> getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo.setValue(userInfo);
    }
}
